package com.huawo.qjs.utils;

import android.app.Application;

import com.sifli.watchfacesdk.manager.SFWatchfaceFilePushManager;
import com.sifli.watchfacesdk.manager.SFWatchfaceFilePushManagerCallback;

public class SFSDK {
    private final static SFSDK mInstance = new SFSDK();

    public static SFSDK getInstance() {
        return mInstance;
    }

    private SFSDK() {

    }

    private SFWatchfaceFilePushManager pushManager;
    private SFWatchfaceFilePushManagerCallback callback;

    public void init(Application application) {
        this.pushManager = SFWatchfaceFilePushManager.getInstance();
        this.pushManager.init(application);
    }

    public void pushWatchface(String deviceMacAddress,int type, String filePath,boolean withByteAlign,  SFWatchfaceFilePushManagerCallback callback) {
        this.callback = callback;
        this.pushManager.setCallback(callback);
        this.pushManager.pushWatchfaceFile(deviceMacAddress, type, filePath, withByteAlign);
    }

    public void stop() {
//        this.callback = null;
        this.pushManager.stop();
    }

    public void cleanUp() {
        this.callback = null;
    }

    public boolean isBusy(){
        return SFWatchfaceFilePushManager.getInstance().isBusy();
    }
}
